import request from '@/utils/request'

// 创建种植信息
export function createPlantingInformation(data) {
  return request({
    url: '/farmer/planting-information/create',
    method: 'post',
    data: data
  })
}

// 更新种植信息
export function updatePlantingInformation(data) {
  return request({
    url: '/farmer/planting-information/update',
    method: 'put',
    data: data
  })
}

// 删除种植信息
export function deletePlantingInformation(id) {
  return request({
    url: '/farmer/planting-information/delete?id=' + id,
    method: 'delete'
  })
}

// 获得种植信息
export function getPlantingInformation(id) {
  return request({
    url: '/farmer/planting-information/get?id=' + id,
    method: 'get'
  })
}

// 获得种植信息分页
export function getPlantingInformationPage(query) {
  return request({
    url: '/farmer/planting-information/page',
    method: 'get',
    params: query
  })
}

// 导出种植信息 Excel
export function exportPlantingInformationExcel(query) {
  return request({
    url: '/farmer/planting-information/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
